package com.example.repository;

import com.example.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student, Integer>, SelfDefineQuery {
    Student findStudentByName(String name);

    List<Student> findStudentByAgeOrderByAgeAsc(Integer age);

    @Query("select s from Student s where s.school like '%科技大学'")
    List<Student> queryAllStudentsBySchoolLikeUniversityOfScienceAndTechnology();


}
